** This file produces Figure 6.2

* Open survey run by YouGov
use UMAS0016_OUTPUT.DTA, clear

* Generate variables for support for limits on each group
gen Parties=ombs_1_a
replace Parties=ombs_2_a if Parties==.

gen Groups=ombs_1_b
replace Groups=ombs_2_b if Groups==.

gen Unions=ombs_1_c
replace Unions=ombs_2_c if Unions==.

gen Business=ombs_1_d
replace Business=ombs_2_d if Business==.

label values Parties LABB
label values Unions LABB
label values Groups LABB
label values Business LABB

* Set weighting
svyset [pw=weight]

* Estimate proportions in each category
svy: proportion Parties Groups Unions Business

* Save dataset for graphing
parmest, saving(finance_preferences, replace)

* Open dataset of proportions
use finance_preferences, clear

* Remaining commands create Figure 6.2
gen notatall=estimate if _n==1 | _n==5 | _n==9 | _n==13
gen lowlimits=estimate if _n==2 | _n==6 | _n==10 | _n==14
gen highlimits=estimate if _n==3 | _n==7 | _n==11 | _n==15
gen nolimits=estimate if _n==4 | _n==8 | _n==12 | _n==16

collapse (max) notatall lowlimits highlimits nolimits, by(eq)

encode eq, gen(source)

graph bar nolimits highlimits lowlimits notatall , over(source, lab) stack scheme(s2color) graphr(c(white)) legend(pos(3) col(1) size(medsmall) lab(1 "With No Limits") lab(2 "With High Limits") lab(3 "With Low Limits") lab(4 "Not At All")) ylabel(, labs(small))  bar(1, col(gs0) fi(0)) bar(2, col(gs0) fi(33))  bar(3, col(gs0) fi(67)) bar(4, col(gs0) fi(100))
graph export fig_6_2.eps, replace


